package a2022.a20220708;

/**
 * @author lenovo
 * @date 2022/7/6
 */
public class a {
    public static void main(String[] args) {
        System.out.println(minCostToMoveChips(new int[]{2, 2, 2, 3, 3}));
    }

    public static int minCostToMoveChips(int[] position) {
        int length = position.length;
        int x = 0, y = 0;
        for (int i : position) {
            if (i % 2 == 0) {
                x ++;
            } else if (i % 2 == 1) {
                y ++;
            }
        }
        return Math.min(x, y);
    }

}
